﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T_Performance.Service
{
    public static class SysLog
    {

        public static StreamWriter sw = null;
        private const string path= "E:\\Program\\t_Performance\\SysLog\\log.txt";

        public static void OpenStream()
        {
            if (!File.Exists(path))
            {
                File.Create(path);
            }

            sw = new StreamWriter(path, true);
        }

        public static void WriteSysLog(string sm)
        {

            Console.WriteLine(sm);

            sw.WriteLine(sm);
            sw.WriteLine("----------------------------------------------------------------------------------------");
            sw.WriteLine("\r");

        }

        public static void CloseStream()
        {
            sw.Close();
            sw = null;
        }

    }
}